import {Component, OnInit, ViewEncapsulation, ChangeDetectionStrategy, Input, HostBinding} from '@angular/core';
import {ImageServeService} from "@shared/service/image/image-serve.service";

@Component({
  selector: 'seed-icons',
  templateUrl: './icon.component.html',
  styleUrls: ['./icon.component.scss'],
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush,
  host: {'class': 'seed-icon'}
})
export class IconComponent implements OnInit {
  private _defaultIcon: string;

  @Input()
  set icon(val) {
    this._defaultIcon = this.imgService.getIconBadgeIcon(val);
  }

  get icon() {
    return this._defaultIcon;
  }

  constructor(private imgService: ImageServeService) {
    this._defaultIcon = this.imgService.getIconBadgeIcon('arrowRight');
  }

  @HostBinding('class.seed-icon')
  ngOnInit() {
  }

}
